package com.aooci.ordercat.vo;

import java.io.Serializable;

import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.beans.property.SimpleFloatProperty;
import javafx.beans.property.FloatProperty;

import com.aooci.ordercat.domain.Item;
import com.aooci.ordercat.enums.OrderedItemType;
@SuppressWarnings("restriction")
public class OrderedItemVo implements Serializable {
	private static final long serialVersionUID = 1L;
	
	private int entityId;
	private final StringProperty label; 
	private final StringProperty name; 
	private final FloatProperty amount;
	private Item item;
	private final IntegerProperty quantity;
	private final FloatProperty price;
	private int modifiedQuantity;
	//private float totalPrice;
	private OrderedItemType type;
	private String remark;
	private final IntegerProperty sortGroup;
	private boolean first = false;
	
	public OrderedItemVo(int entityId, String label, String name, float amount, Item item, int quantity, float price, int modifiedQuantity,
			OrderedItemType type, String remark,
			int sortGroup) {
		super();
		this.entityId = entityId;
		this.label = new SimpleStringProperty(label);
		this.name = new SimpleStringProperty(name);
		this.amount = new SimpleFloatProperty(amount);
		this.item = item;
		this.quantity = new SimpleIntegerProperty(quantity);
		this.price = new SimpleFloatProperty(price);
		this.modifiedQuantity = modifiedQuantity;
		//this.totalPrice = totalPrice;
		this.type = type;
		this.remark = remark;
		this.sortGroup = new SimpleIntegerProperty(sortGroup);
	}
	/**
	 * @return the entityId
	 */
	public int getEntityId() {
		return entityId;
	}
	/**
	 * @param entityId the entityId to set
	 */
	public void setEntityId(int entityId) {
		this.entityId = entityId;
	}
	
	/**
	 * @return the label
	 */
	public String getLabel() {
		return label.get();
	}
	/**
	 * @param label the label to set
	 */
	public void setLabel(String label) {
		this.label.set(label);
	}
	
	public StringProperty labelProperty() {
		return label;
	}
	/**
	 * @return the label
	 */
	public String getName() {
		return name.get();
	}
	/**
	 * @param label the label to set
	 */
	public void setName(String name) {
		this.name.set(name);
	}
	
	public StringProperty nameProperty() {
		return name;
	}
	/**
	 * @return the price
	 */
	public float getAmount() {
		return amount.get();
	}
	/**
	 * @param price the price to set
	 */
	public void setAmount(float amount) {
		this.amount.set(amount);
	}
	public FloatProperty amountProperty(){
		return amount;
	}
	/**
	 * @return the item
	 */
	public Item getItem() {
		return item;
	}
	/**
	 * @param item the item to set
	 */
	public void setItem(Item item) {
		this.item = item;
	}
	/**
	 * @return the count
	 */
	public int getQuantity() {
		return quantity.get();
	}
	/**
	 * @param count the count to set
	 */
	public void setQuantity(int quantity) {
		this.quantity.set(quantity);
	}
	
	public IntegerProperty quantityProperty(){
		return this.quantity;
	}
	/**
	 * @return the modifiedCount
	 */
	public int getModifiedQuantity() {
		return modifiedQuantity;
	}
	/**
	 * @param modifiedCount the modifiedCount to set
	 */
	public void setModifiedQuantity(int modifiedQuantity) {
		this.modifiedQuantity = modifiedQuantity;
	}

	/**
	 * @return the type
	 */
	public OrderedItemType getType() {
		return type;
	}
	/**
	 * @param type the type to set
	 */
	public void setType(OrderedItemType type) {
		this.type = type;
	}
	/**
	 * @return the remark
	 */
	public String getRemark() {
		return remark;
	}
	/**
	 * @param remark the remark to set
	 */
	public void setRemark(String remark) {
		this.remark = remark;
	}
	/**
	 * @return the sortGroup
	 */
	public int getSortGroup() {
		return sortGroup.get();
	}
	/**
	 * @param sortGroup the sortGroup to set
	 */
	public void setSortGroup(int sortGroup) {
		this.sortGroup.set(sortGroup);
	}
	public IntegerProperty sortGroupProperty(){
		return this.sortGroup;
	}
	/**
	 * @return the first
	 */
	public boolean isFirst() {
		return first;
	}
	/**
	 * @param first the first to set
	 */
	public void setFirst(boolean first) {
		this.first = first;
	}
	/**
	 * @return the unitPrice
	 */
	public float getPrice() {
		return price.get();
	}
	/**
	 * @param unitPrice the unitPrice to set
	 */
	public void setPrice(float price) {
		this.price.set(price);
	}
	
	public FloatProperty priceProperty(){
		return this.price;
	}
}
